package cn.springcloud.fix.user.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RefreshScope
@RestController
public class UserController {

    private static final String REST_URL_PREFIX = "http://SPRINGCLOUD-PROVIDER";

    // private RestTemplate restTemplate;

    // @GetMapping(value = "/user/discovery")
    // public Object discovery() {
    //     return restTemplate.getForObject(REST_URL_PREFIX + "/discovery", Object.class);
    // }

    @Value("${user.info}")
    private String configInfo;

    @GetMapping("/configInfo")
    public String getConfigInfo() {
        return configInfo;
    }

    @GetMapping(value = "/user/getByUsername")
    public Object getByUsername() {
        return "ok";
    }
}
